import wx

class Example(wx.Frame):
    def __init__(self, parent, title):
        super(Example, self).__init__(parent, title=title)
        self.InitUI()
    def InitUI(self):
        panel = wx.Panel(self)
        hbox = wx.BoxSizer()
        sizer = wx.GridSizer(2,2,2,2)
        btn1 = wx.Button(panel, label='Info')
        btn2 = wx.Button(panel, label='Error')
        btn3 = wx.Button(panel, label='Question')
        btn4 = wx.Button(panel, label='Alert')

        sizer.AddMany([btn1, btn2, btn3, btn4])
        hbox.Add(sizer, 0, wx.ALL, 15)
        panel.SetSizer(hbox)

        btn1.Bind(wx.EVT_BUTTON, self.ShowMessage1)
        btn2.Bind(wx.EVT_BUTTON, self.ShowMessage2)
        btn3.Bind(wx.EVT_BUTTON, self.ShowMessage3)
        btn4.Bind(wx.EVT_BUTTON, self.ShowMessage4)

    def ShowMessage1(self, e):
        dial = wx.MessageDialog(None, 'this is info', "Info", wx.OK)
        dial.ShowModal()
    def ShowMessage2(self, e):
        dial = wx.MessageDialog(None, 'this is error', 'Error', wx.OK|wx.ICON_ERROR)
        dial.ShowModal()
    def ShowMessage3(self, e):
        dial = wx.MessageDialog(None, 'this is question', 'Question', wx.YES_NO |wx.NO_DEFAULT|wx.ICON_QUESTION )
        dial.ShowModal()
    def ShowMessage4(self, e):
        dial = wx.MessageDialog(None, 'this is alert', 'Alert', wx.OK|wx.ICON_EXCLAMATION)
        dial.ShowModal()

def main():
    app = wx.App()
    frame = Example(None, title='simple dialog')
    frame.Show()
    app.MainLoop()

if __name__ == '__main__':
    main()
